using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.ApplicationBlocks.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace DataHelper.DAL
{
    public class TK_Station
    {
private static  string m_trConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;

       #region TK_StationSelectAll
        public static SqlDataReader TK_StationSelectAll(string strSearch="",int top = 1, int bottom = 20, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
                return SqlHelper.ExecuteReader(ConnectionString, "TK_StationSelectAllRows",strSearch,top,bottom);
            return SqlHelper.ExecuteReader(m_trConnectionString, "TK_StationSelectAllRows",strSearch,top,bottom);
        }
        #endregion
       #region TK_StationSelectRow
        public static SqlDataReader TK_StationSelectRow(int ID, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
                return SqlHelper.ExecuteReader(ConnectionString, "TK_StationSelectRow", ID);
            return SqlHelper.ExecuteReader(m_trConnectionString, "TK_StationSelectRow", ID);
        }
        #endregion
       #region TK_StationInsertRow
        public static void TK_StationInsertRow(int ID, string Name, string Code, int CountryID, string CountryName, string StationTo, bool IsDeleted, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
            {
                SqlHelper.ExecuteNonQuery(ConnectionString, "TK_StationInsertRow", ID, Name, Code, CountryID, CountryName, StationTo, IsDeleted);
                return;
            }
            SqlHelper.ExecuteNonQuery(m_trConnectionString, "TK_StationInsertRow", ID, Name, Code, CountryID, CountryName, StationTo, IsDeleted);
        }
        #endregion
       #region TK_StationUpdateRow
        public static void TK_StationUpdateRow(int ID, string Name, string Code, int CountryID, string CountryName, string StationTo, bool IsDeleted, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
            {
                SqlHelper.ExecuteNonQuery(ConnectionString, "TK_StationUpdateRow", ID, Name, Code, CountryID, CountryName, StationTo, IsDeleted);
                return;
            }
            SqlHelper.ExecuteNonQuery(m_trConnectionString, "TK_StationUpdateRow", ID, Name, Code, CountryID, CountryName, StationTo, IsDeleted);
        }
        #endregion
       #region TK_StationDeleteRow
        public static void TK_StationDeleteRow(int ID, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
            {
                SqlHelper.ExecuteNonQuery(ConnectionString, "TK_StationDeleteRow", ID);
                return;
            }
            SqlHelper.ExecuteNonQuery(m_trConnectionString, "TK_StationDeleteRow", ID);
        }
        #endregion

    }
}

